package thread;

public class Demo16 {
    public static void main(String[] args) throws InterruptedException {
        Thread mainthread=Thread.currentThread();
        Thread t=new Thread(()->{
            System.out.println("开始等待main");
            try {
                mainthread.join();
                System.out.println("结束等待 main");
            }catch (InterruptedException e){
                throw new RuntimeException(e);
            }
        });
        t.start();
        Thread.sleep(3000);
        System.out.println("main结束");
    }
}
